Trigonometric funtions from "10,000 CIRCLES"

Charlie Veniot20th June 2022 at 1:02am
' The trigonometric functions by Hamid Naderi Yeganeh from his original art (10,000 CIRCLES)
' https://blogs.scientificamerican.com/guest-blog/making-mathematical-art/

pi = 3.1415929
screen _newimage(2500, 2200, 21)
for k = 1 to 10000
x = int ( cos(14 * pi * k / 10000) * ( 1 - ( 3 / 4 ) * (cos(20 * pi * k / 10000))^2 ) * 1000 )
y = int ( sin(14 * pi * k / 10000) * ( 1 - ( 3 / 4) * (cos(24 * pi * k / 10000))^2 ) * 1000 )
r = int ( ( 1 / 200 + 1 / 10 * (sin(54 * pi * k / 10000))^6 ) * 1000 )
' print x, y, r
if r > 70 then
   c = 255 * 256^2 + r * 256 + r
elseif r < 70 and r > 10 then
   c = r * 256^2 + 255 * 256 + r
else
   c = (255-r) * 256 + 255
end if
circle (x+1200,y+1100), r, c
next k